package work20241203_chap6oop.r_demo15;

import java.util.Arrays;

/**
 * @author zdl
 * @date 2024/12/5
 */

public class Demo {
    public static void main(String[] args) {
        Employee[] employees = new Employee[4];
        employees[0] = new SalariedEmployee("张三",12,4000);
        employees[1] = new  HourlyEmployee("李四",12,30,170);
        employees[2] = new SalesEmployee("王五",12,3000,0.2);
        employees[3] = new BasePlusSalesEmployee("刘琦",12,2000,0.2,2000);
        for (Employee e:employees) {
            System.out.println(e.getName()+"的工资为:"+e.getSalary(12));
        }
        System.out.println();
        for (int i = 0; i < employees.length; i++) {
            System.out.println(employees[i].getSalary(11));
        }

    }
}
